package com.ruoyi.lucky.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.lucky.mapper.TExchageMapper;
import com.ruoyi.lucky.domain.TExchage;
import com.ruoyi.lucky.service.ITExchageService;
import com.ruoyi.common.core.text.Convert;

/**
 * 商品兑换记录Service业务层处理
 * 
 * @author liuhongbin
 * @date 2020-11-15
 */
@Service
public class TExchageServiceImpl implements ITExchageService 
{
    @Autowired
    private TExchageMapper tExchageMapper;

    /**
     * 查询商品兑换记录
     * 
     * @param id 商品兑换记录ID
     * @return 商品兑换记录
     */
    @Override
    public TExchage selectTExchageById(Integer id)
    {
        return tExchageMapper.selectTExchageById(id);
    }

    /**
     * 查询商品兑换记录列表
     * 
     * @param tExchage 商品兑换记录
     * @return 商品兑换记录
     */
    @Override
    public List<TExchage> selectTExchageList(TExchage tExchage)
    {
        return tExchageMapper.selectTExchageList(tExchage);
    }

    /**
     * 新增商品兑换记录
     * 
     * @param tExchage 商品兑换记录
     * @return 结果
     */
    @Override
    public int insertTExchage(TExchage tExchage)
    {
        tExchage.setCreateTime(DateUtils.getNowDate());
        return tExchageMapper.insertTExchage(tExchage);
    }

    /**
     * 修改商品兑换记录
     * 
     * @param tExchage 商品兑换记录
     * @return 结果
     */
    @Override
    public int updateTExchage(TExchage tExchage)
    {
        tExchage.setUpdateTime(DateUtils.getNowDate());
        return tExchageMapper.updateTExchage(tExchage);
    }

    /**
     * 删除商品兑换记录对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTExchageByIds(String ids)
    {
        return tExchageMapper.deleteTExchageByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除商品兑换记录信息
     * 
     * @param id 商品兑换记录ID
     * @return 结果
     */
    @Override
    public int deleteTExchageById(Integer id)
    {
        return tExchageMapper.deleteTExchageById(id);
    }
}
